package com.atguigu.observe;

import java.util.Observable;

public class ObserverDemo extends Observable {
    public static void main(String[] args) {
        ObserverDemo ob = new ObserverDemo();
        ob.addObserver((o, arg) -> System.out.println("数据发生变化：" + arg));
        ob.addObserver((o, arg) -> System.out.println("<UNK>" + arg));

        ob.setChanged();
        ob.notifyObservers();
    }
}
